<template>
  <div class="feed-user">
    <HNav v-model="tabIndex"></HNav>
    <div class="nav-tab">
      <div class="tab-btn" :class="{'active': navActive === 0}" @click="navActive = 0; showDetail = false">当前话题</div>
      <div class="tab-btn" :class="{'active': navActive === 1}" @click="navActive = 1; showDetail = false">我的关注</div>
      <div class="tab-btn" :class="{'active': navActive === 2}" @click="navActive = 2; showDetail = false">最新动态</div>
    </div>

    <div class="user-feed">
      <FeedUserBtn> </FeedUserBtn>
      <div class="flex align-center justify-between  head">
        <div class="count">全部动态</div>
        <div class="flex align-center filters">
          <div class="filter active">最新</div>
          <div class="border"></div>
          <div class="filter">默认</div>
        </div>
      </div>

      <div class="feed-ul">
        <div class="feed-item" v-for="(item) in [1,2,3,4,5,6,7,7,]">
          <div class="name">通过法考的，可以传授下经验吗？</div>
          <div class="mark">答主是去年参加法考，客观题223分，主观题134分，
            顺利一次通过。由于我是大龄在职非法本零考……答主是去年参加法考，客观题223分，主观题134分，
            顺利一次通过。由于我是大龄在职非法本零考……</div>
          <div class="flex align-center justify-between">
            <div class="date">2020-02-18</div>
            <div class="flex align-center">
              <div class="btn">
                <image class="btn-icon"></image>
              </div>
              <div class="btn">
                <image class="btn-icon"></image>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref} from "vue";
import FeedUserBtn from "../../components/FeedUserBtn.vue";
import HNav from "../../components/HNav.vue";

const navActive = ref(1);
const showDetail = ref(false);
const tabIndex = ref(1);
</script>

<style lang="scss" scoped>
.nav-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 50rpx 40rpx;
  border-bottom: 1rpx solid rgba(0, 0, 0, 0.08);
  .tab-btn {
    width: 216rpx;
    height: 68rpx;
    border-radius: 36rpx;
    font-size: 32rpx;
    font-weight: 300;
    line-height: 68rpx;
    text-align: center;
    color: #0D3333;
    &.active {
      background: rgba(36, 250, 246, 0.38);
      font-weight: 500;
    }
  }
}

.user-feed {
  padding: 32rpx;
  .head {
    height: 104rpx;
    background: #FFFFFF;
    padding: 32rpx 0 0;
    .count {
      height: 40rpx;
      font-size: 28rpx;
      font-weight: 500;
      color: #0D3333;
      line-height: 40rpx;
    }
    .filters {
      .filter {
        height: 34rpx;
        font-size: 24rpx;
        font-weight: 400;
        color: #0D3333;
        line-height: 34rpx;
      }
      .border {
        width: 2rpx;
        height: 20rpx;
        background: rgba(13, 51, 51, 0.25);
        margin: 0 24rpx;
      }
    }
  }

}

.feed-ul {
  padding: 32rpx 0;
  //background: #F7F7F7;
  .feed-item {
    padding: 32rpx 38rpx;
    background: #FFFFFF;
    border-radius: 24rpx;
    margin-bottom: 24rpx;
    border: 2rpx solid rgba(0,0,0,0.08);
    .name {
      height: 44rpx;
      font-size: 32rpx;
      font-weight: 500;
      color: #0D3333;
      line-height: 44rpx;
    }
    .mark {
      font-size: 24rpx;
      font-weight: 400;
      color: #0D3333;
      margin: 30rpx 0 36rpx;
    }
    .date {
      height: 32rpx;
      font-size: 22rpx;
      font-weight: 400;
      color: #0D3333;
      line-height: 32rpx;
    }
    .btn {
      margin: 0 0 0 16rpx;
      .btn-icon {
        width: 42rpx;
        height: 42rpx;
        background: #0D3333;
      }
    }
  }
}
</style>
